package com.leesche.zcsp.node.web.service.impl;

import com.leesche.zcsp.node.web.dao.PubDevConfigParamDao;
import com.leesche.zcsp.node.web.model.PubDevConfigParam;
import com.leesche.zcsp.node.web.model.PubDevConfigParamCriteria;
import com.leesche.zcsp.node.web.service.PubDevConfigParamService;
import com.leesche.zcsp.node.web.service.impl.data.read.PubDevConfigParamDto;
import com.leesche.zcsp.node.web.service.impl.data.read.QueryPubDevConfigParamCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2017-01-05.
 */
@Service
@Transactional
public class PubDevConfigParamServiceImpl  extends BaseServiceImpl<PubDevConfigParam, PubDevConfigParamCriteria, PubDevConfigParamDto, QueryPubDevConfigParamCondition, Long>
implements PubDevConfigParamService {

    @Autowired
    private PubDevConfigParamDao pubDevConfigParamDao;

    @Autowired
    public void setBaseDao(PubDevConfigParamDao pubDevConfigParamDao) {

        super.setBaseDao(pubDevConfigParamDao);
    }

    @Override
    public int checkCommId(int isOperator, Long deviceTypeId, int commId) {
        QueryPubDevConfigParamCondition condition = new QueryPubDevConfigParamCondition();
        condition.setIsOperator(isOperator);
        condition.setDeviceTypeId(deviceTypeId);
        condition.setCommId(commId);
        return pubDevConfigParamDao.checkCommId(condition);
    }
}
